home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gnumake / gnumake.zoo / diffs next >
Text File  |  1990-02-16  |  22KB  |  882 lines

  1. *** make-3.58/orig/arscan.c    Fri Oct 20 01:46:34 1989
  2. --- make-3.58/arscan.c    Fri Feb 16 21:15:10 1990
  3. ***************
  4. *** 24,30 ****
  5. --- 24,34 ----
  6.   #define PORTAR 1
  7.   #endif
  8.   
  9. + #ifdef GEMDOS
  10. + #include <gnu-ar.h>
  11. + #else
  12.   #include <ar.h>
  13. + #endif
  14.   #include <stdio.h>
  15.   #include <sys/types.h>
  16.   #include <sys/stat.h>
  17. ***************
  18. *** 266,271 ****
  19. --- 270,279 ----
  20.     if (!pos)
  21.       return 1;
  22.   
  23. + #ifdef GEMDOS
  24. +   if (utime(arname, 0L) < 0)    /* GEMDOS needs this to touch the file */
  25. +     return -3;
  26. + #endif
  27.     fd = open (arname, O_RDWR, 0666);
  28.     if (fd < 0)
  29.       return -3;
  30. ***************
  31. *** 280,286 ****
  32. --- 288,298 ----
  33.     if (sizeof ar_hdr != write (fd, (char *) &ar_hdr, sizeof ar_hdr))
  34.       goto lose;
  35.     /* The file's mtime is the time we we want.  */
  36. + #ifdef GEMDOS
  37. +   stat(arname, &statbuf);
  38. + #else
  39.     fstat (fd, &statbuf);
  40. + #endif
  41.   #ifdef ARFMAG
  42.     /* Advance member's time to that time */
  43.     for (i = 0; i < sizeof ar_hdr.ar_date; i++)
  44. *** make-3.58/orig/commands.c    Mon Feb 12 19:43:02 1990
  45. --- make-3.58/commands.c    Mon Feb 12 19:23:34 1990
  46. ***************
  47. *** 342,347 ****
  48. --- 342,348 ----
  49.        int sig;
  50.   {
  51.     signal (sig, SIG_DFL);
  52. + #ifndef GEMDOS
  53.   #ifndef USG
  54.     (void) sigsetmask (0);
  55.   #endif
  56. ***************
  57. *** 387,392 ****
  58. --- 388,394 ----
  59.       wait_for_children (0, 1);
  60.   
  61.     /* Delete any non-precious intermediate files that were made.  */
  62. + #endif /* GEMDOS */
  63.   
  64.     remove_intermediates (1);
  65.   
  66. *** make-3.58/orig/dir.c    Wed Oct  4 01:12:46 1989
  67. --- make-3.58/dir.c    Mon Jan 29 22:47:32 1990
  68. ***************
  69. *** 36,41 ****
  70. --- 36,47 ----
  71.   #endif    /* USGr3 or DIRENT.  */
  72.   
  73.   
  74. + #ifdef GEMDOS
  75. + #define HASH_LIMIT 8    /* only consider this many characters of file names */
  76. + static short _limit = 0;
  77. + #endif
  78.   /* Hash table of directories.  */
  79.   
  80.   struct directory
  81. ***************
  82. *** 83,94 ****
  83. --- 89,108 ----
  84.     register char *p;
  85.     register struct directory *dir;
  86.   
  87. + #ifdef GEMDOS
  88. +   for (p = name, _limit = HASH_LIMIT; *p != '\0' && _limit-- > 0; ++p)
  89. + #else
  90.     for (p = name; *p != '\0'; ++p)
  91. + #endif
  92.       HASH (hash, *p);
  93.     hash %= DIRECTORY_BUCKETS;
  94.   
  95.     for (dir = directories[hash]; dir != 0; dir = dir->next)
  96. + #ifdef GEMDOS
  97. +     if (DOS_streq (dir->name, name))
  98. + #else
  99.       if (streq (dir->name, name))
  100. + #endif
  101.         break;
  102.   
  103.     if (dir == 0)
  104. ***************
  105. *** 151,157 ****
  106. --- 165,175 ----
  107.       /* Checking if the directory exists.  */
  108.       return 1;
  109.   
  110. + #ifdef GEMDOS
  111. +       for (p = filename,_limit = HASH_LIMIT; *p != '\0' && _limit-- > 0; ++p)
  112. + #else
  113.         for (p = filename; *p != '\0'; ++p)
  114. + #endif
  115.       HASH (hash, *p);
  116.         hash %= DIRFILE_BUCKETS;
  117.   
  118. ***************
  119. *** 158,164 ****
  120. --- 176,186 ----
  121.         /* Search the list of hashed files.  */
  122.   
  123.         for (df = dir->files[hash]; df != 0; df = df->next)
  124. + #ifdef GEMDOS
  125. +     if (DOS_streq (df->name, filename))
  126. + #else
  127.       if (streq (df->name, filename))
  128. + #endif
  129.         return !df->impossible;
  130.       }
  131.   
  132. ***************
  133. *** 174,180 ****
  134. --- 196,206 ----
  135.         /* Enter the file in the hash table.  */
  136.         register unsigned int newhash = 0;
  137.         register unsigned int i;
  138. + #ifdef GEMDOS
  139. +       for (i = 0, _limit = HASH_LIMIT; i < D_NAMLEN(d) && _limit-- > 0; ++i)
  140. + #else
  141.         for (i = 0; i < D_NAMLEN(d); ++i)
  142. + #endif
  143.       HASH (newhash, d->d_name[i]);
  144.         newhash %= DIRFILE_BUCKETS;
  145.         df = (struct dirfile *) xmalloc (sizeof (struct dirfile));
  146. ***************
  147. *** 184,191 ****
  148.         df->impossible = 0;
  149.   
  150.         /* Check if the name matches the one we're searching for.  */
  151. !       if (filename != 0
  152. !       && newhash == hash && streq (d->d_name, filename))
  153.       return 1;
  154.       }
  155.   
  156. --- 210,222 ----
  157.         df->impossible = 0;
  158.   
  159.         /* Check if the name matches the one we're searching for.  */
  160. !       if (filename != 0 && newhash == hash 
  161. ! #ifdef GEMDOS
  162. !       && DOS_streq (d->d_name, filename)
  163. ! #else
  164. !       && streq (d->d_name, filename)
  165. ! #endif
  166. !                     )
  167.       return 1;
  168.       }
  169.   
  170. ***************
  171. *** 251,257 ****
  172. --- 282,293 ----
  173.         filename = p = dirend + 1;
  174.       }
  175.   
  176. + #ifdef GEMDOS
  177. +   _limit = HASH_LIMIT;
  178. +   for (hash = 0; *p != '\0' && _limit-- > 0; ++p)
  179. + #else
  180.     for (hash = 0; *p != '\0'; ++p)
  181. + #endif
  182.       HASH (hash, *p);
  183.     hash %= DIRFILE_BUCKETS;
  184.   
  185. ***************
  186. *** 300,311 ****
  187. --- 336,356 ----
  188.       /* There are no files entered for this directory.  */
  189.       return 0;
  190.   
  191. + #ifdef GEMDOS
  192. +   _limit = HASH_LIMIT;
  193. +   for (hash = 0; *p != '\0' && _limit-- > 0; ++p)
  194. + #else
  195.     for (hash = 0; *p != '\0'; ++p)
  196. + #endif
  197.       HASH (hash, *p);
  198.     hash %= DIRFILE_BUCKETS;
  199.   
  200.     for (next = dir->files[hash]; next != 0; next = next->next)
  201. + #ifdef GEMDOS
  202. +     if (DOS_streq (filename, next->name))
  203. + #else
  204.       if (streq (filename, next->name))
  205. + #endif
  206.         return next->impossible;
  207.   
  208.     return 0;
  209. ***************
  210. *** 381,383 ****
  211. --- 426,469 ----
  212.       printf ("%u", impossible);
  213.     printf (" impossibilities in %u directories.\n", dirs);
  214.   }
  215. + #ifdef GEMDOS
  216. + /* checks to see if two names refer to the same file */
  217. + int DOS_streq(name1, name2)
  218. + char *name1, *name2;
  219. + {
  220. +     static char _name1[64], _name2[64];
  221. +     char *lastslash;
  222. +     extern char *rindex();
  223. +     int i;
  224. +     if (!strcmp(name1, name2)) return 1;
  225. +     unx2dos(name1, _name1);
  226. +     unx2dos(name2, _name2);
  227. +     name1 = rindex(_name1, '\\'); if (!name1) name1 = _name1;
  228. +     name2 = rindex(_name2, '\\'); if (!name2) name2 = _name2;
  229. +     for(i = 8; i>0; i--) {
  230. +         if (*name1 != *name2) return 0;
  231. +         if (*name1 == 0)
  232. +             return 1;
  233. +         if (*name1 == '.')
  234. +             goto doext;
  235. +         name1++; name2++;
  236. +     }
  237. + /* now look for extension */
  238. +     while (*name1 && *name1 != '.') name1++;
  239. +     while (*name2 && *name2 != '.') name2++;
  240. +     if (*name1 != *name2) return 0;
  241. + doext:
  242. +     name1++; name2++;
  243. +     for (i = 3; i > 0; i--) {
  244. +         if (*name1 != *name2) return 0;
  245. +         if (!*name1) return 1;
  246. +         name1++; name2++;
  247. +     }
  248. +     return 1;
  249. + }
  250. + #endif /* GEMDOS */
  251. *** make-3.58/orig/function.c    Mon Feb 12 19:43:06 1990
  252. --- make-3.58/function.c    Mon Feb 12 19:24:16 1990
  253. ***************
  254. *** 337,342 ****
  255. --- 337,345 ----
  256.       else
  257.         buf[0] = '\0';
  258.   
  259. + #ifdef GEMDOS
  260. +     perror_with_name (buf, "function not allowed under GEMDOS");
  261. + #else
  262.       if (pipe (pipedes) < 0)
  263.         {
  264.           perror_with_name (buf, "pipe");
  265. ***************
  266. *** 430,435 ****
  267. --- 433,439 ----
  268.           free (buffer);
  269.         }
  270.   
  271. + #endif /* GEMDOS */
  272.       free (text);
  273.       break;
  274.         }
  275. *** make-3.58/orig/job.c    Mon Feb 12 19:43:12 1990
  276. --- make-3.58/job.c    Tue Feb 13 18:50:50 1990
  277. ***************
  278. *** 23,28 ****
  279. --- 23,34 ----
  280.   #include "variable.h"
  281.   #include <errno.h>
  282.   
  283. + #ifdef GEMDOS
  284. + #include <ctype.h>
  285. + extern char *findfile();
  286. + static char *_extensions[] = { "ttp", "prg", "tos", 0 };
  287. + #endif
  288.   extern int errno;
  289.   
  290.   #if    defined(USG) && !defined(HAVE_VFORK)
  291. ***************
  292. *** 33,39 ****
  293.   #endif    /* USG and don't have vfork.  */
  294.   extern int vfork ();
  295.   
  296. ! #if    defined(HAVE_SYS_WAIT) || !defined(USG)
  297.   #include <sys/wait.h>
  298.   #include <sys/time.h>
  299.   #include <sys/resource.h>
  300. --- 39,45 ----
  301.   #endif    /* USG and don't have vfork.  */
  302.   extern int vfork ();
  303.   
  304. ! #if    (defined(HAVE_SYS_WAIT) || !defined(USG)) && !defined(GEMDOS)
  305.   #include <sys/wait.h>
  306.   #include <sys/time.h>
  307.   #include <sys/resource.h>
  308. ***************
  309. *** 62,67 ****
  310. --- 68,84 ----
  311.   
  312.   #else    /* WTERMSIG not defined and have <sys/wait.h> or not USG.  */
  313.   
  314. + # ifdef GEMDOS
  315. + #  define WAIT_T int
  316. + #  define WTERMSIG(x) 0
  317. + #  define WCOREDUMP(x) 0
  318. + #  define WEXITSTATUS(x)  x
  319. + #  define WIFSIGNALED(x) (WTERMSIG (x) != 0)
  320. + #  define WIFEXITED(x) (WTERMSIG (x) == 0)
  321. + # else
  322.   #define WAIT_T union wait
  323.   #define WTERMSIG(x) ((x).w_termsig)
  324.   #define WCOREDUMP(x) ((x).w_coredump)
  325. ***************
  326. *** 70,75 ****
  327. --- 87,94 ----
  328.   #define    WIFSIGNALED(x)    (WTERMSIG(x) != 0)
  329.   #endif
  330.   
  331. + #endif  /* GEMDOS */
  332.   #endif    /* WTERMSIG defined or USG and don't have <sys/wait.h>.  */
  333.   
  334.   
  335. ***************
  336. *** 153,159 ****
  337. --- 172,180 ----
  338.        Using the default action does the right thing.  */
  339.     (void) signal (SIGCLD, SIG_DFL);
  340.   #else
  341. + # ifndef GEMDOS
  342.     (void) sigblock (sigmask (SIGCHLD));
  343. + # endif
  344.   #endif
  345.   
  346.     block_remote